package com.cmcc.example.face.noSdk.common.vo.request;

import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * <name>FaceSetDeleteVO</name>
 * 删除人脸库请求对象
 * </p >
 *
 * @author arabira
 * @version 1.0 2020-04-08
 * @since 1.0
 */
@Data
public class FaceSetDeleteVO implements Serializable {
    private static final long serialVersionUID = -7732753253393204122L;
    private String faceSetIds;

    public FaceSetDeleteVO(List<String> faceSetIdList) {
        String faceSetIds = faceSetIdList.stream().reduce((id,id2) -> {
            String value = "";
            if (faceSetIdList.indexOf(id) == 0) {
                value = id + "," + id2;
            }
            else {
                value = id + "" + id2;
            }
            if (faceSetIdList.indexOf(id2) != (faceSetIdList.size() - 1)){
                value += ",";
            }
            return value;
        }).get();
        this.faceSetIds = faceSetIds;
    }
}